/**
 * 适配浏览器，判断不可用则return
 * 增加onLoad事件
 */
addLoad(linkClick());

function linkClick() {
    if (!document.getElementById) return false;
    if (!document.getElementsByTagName) return false;
    var ulPhoto = document.getElementById("ul_photo");
    var aArray = ulPhoto.getElementsByTagName("a");
    for (var i = 0; i < aArray.length; i++) {
        aArray[i].onclick = function () {
            showPic(this);
            return false;
        }
    }
}

function showPic(whichPic) {
    if (!document.getElementById) return false;
    if (!document.getElementsByTagName) return false;
    var imgPlace = document.getElementById("img_place");
    var pPlace = document.getElementById("p_place");
    var picSrcPath = whichPic.getAttribute("href");
    var title = whichPic.getAttribute("title");
    imgPlace.setAttribute("src", picSrcPath);
    pPlace.firstChild.nodeValue = title;
}

function addLoad(newFunction) {
    var preFunction = window.onload();
    if (typeof preFunction !== "function") {
        newFunction();
    }else{
        preFunction();
        newFunction();
    }
}